package com.atguigu.day09.test.o3;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/9 11:03
 * @注释 创建一个Person的子类Teacher，新建一个变量成绩，并重写getInfo方法
 */
public class Teacher extends Person{
    private double salary;

    @Override
    public String toString() {
        return super.toString() + ", salary=" + salary;
    }
    /*@Override
    public String getInfo() {
        return super.getInfo() + ", 薪资: " + salary;
    }*/

    public Teacher(String name, int age, char gender, double salary) {
        super(name, age, gender);
        this.salary = salary;
    }

    public Teacher() {
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}
